/**
 * 功能: Notification calss
 * @author Conan
 * @CreatedTime 2020-04-09
 */
import { Notification } from 'element-ui'

/**
 * 功能: 基础 class
 * @parame:
 * @desc:
 */
class NF {
  constructor(message = '', title, type, duration = 4000) {
    this.message = message
    this.duration = duration
    this.title = title
    this.type = type
  }
  init() {
    Notification({
      title: this.title,
      message: this.message,
      type: this.type,
      duration: this.duration
    })
  }
}

/**
 * 功能: 成功提示
 * @parame:
 * @desc:
 */
class NfSuccess extends NF {
  constructor(message = '操作成功', title = '成功', type = 'success') {
    super(message, title, type)
    this.init()
  }
}

/**
 * 功能: 警告提示
 * @parame:
 * @desc:
 */
class NfWarning extends NF {
  constructor( message = '警告提示信息', title = '警告', type = 'warning') {
    super(message, title, type)
    this.init()
  }
}


/**
 * 功能: 信息
 * @parame:
 * @desc:
 */
class NfInfo extends NF {
  constructor( message = '提示信息', title = '消息', type = 'info') {
    super(message, title, type)
    this.init()
  }
}

/**
 * 功能: 错误
 * @parame:
 * @desc:
 */
class NfError extends NF {
  constructor( message = '错误提示信息', title = '错误', type = 'error') {
    super(message, title, type)
    this.init()
  }
}

export {
  NfSuccess,
  NfWarning,
  NfInfo,
  NfError,
}
